<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li ><a href="{:url('Guide/index')}">列表</a></li>
			<li class="active"><a >编辑</a></li>
		</ul>		
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('Guide/edit_post')}">
		   <input type="hidden" name="id" value="{$data['id']}">
           <input type="hidden" name="type" value="{$data['type']}">
			<fieldset>

				
				<div class="form-group" >
					<label for="input-orderno" class="col-sm-2 control-label"><span class="form-required">*</span>序号</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-orderno"  name="orderno" value="{$data['orderno']}">
					</div>
				</div>
				

				<if condition="$data['type'] eq 0">
				<div class="form-group">
					<label for="input-user_login" class="col-sm-2 control-label"><span class="form-required">*</span>图片</label>
					<div class="col-md-6 col-sm-10">
						<input type="hidden" name="thumb" id="thumbewm" value="{$data['thumb']}">
						<a href="javascript:uploadOneImage('图片上传','#thumbewm');">
						<if condition="$data['thumb'] neq ''">
							<img src="{:get_upload_path($data['thumb'])}"
										 id="thumbewm-preview"
										 style="cursor: pointer;max-width:150px;max-height:150px;"/>
						<else/>
							<img src="__TMPL__/public/assets/images/default-thumbnail.png" id="thumbewm-preview" style="cursor: pointer;max-width:150px;max-height:150px;"/>
						</if>
						</a>
						<input type="button" class="btn btn-sm btn-cancel-thumbewm" value="取消图片">
					</div>
				</div>
                </if>

                <if condition="$data['type'] eq 1">
				<div class="form-group">
					<label for="input-user_login" class="col-sm-2 control-label">视频</label>
					<div class="col-md-6 col-sm-10">
						<input type="hidden" name="thumb" id="thumb3" value="{$data['thumb']}">
						<input type="text"  value="{:cmf_get_image_preview_url($data['thumb'])}" style="width:500px;display: inline-block;" class="form-control" />
						<input type="file" name="file" style="display: inline-block;" />
                        <input type="button" class="btn btn-small" onclick="$('#thumb3').val('');return false;" value="取消"> 仅限MP4格式 10M以内
						<span class="form-required"></span>
					</div>
				</div>
				
                </if>

				<div class="form-group" >
					<label for="input-href" class="col-sm-2 control-label">链接</label>
					<div class="col-md-6 col-sm-10">
						<input type="text"class="form-control" id="input-href"  name="href" value="{$data['href']}">点击打开的页面链接 http开头
					</div>
				</div>
			</fieldset>

			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
					<a class="btn btn-default" href="{:url('Guide/index')}">{:lang('BACK')}</a>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script type="text/javascript">
		(function(){
			$("#swftype label.radio").on('click',function(){
				var v=$("input",this).val();
				var b=$("#swftype_bd_"+v);
				b.siblings().hide();
				b.show();
			});
			
			
			
			$('.btn-cancel-thumbewm').click(function () {
				$('#thumbewm-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
				$('#thumbewm').val('');
			});
			
		})()


	</script>

</body>
</html>